package com.base.cn.platform.os.service.course.favorites;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.course.CourseBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 课程收藏Service接口
 *
 * @author s.li
 * @date 2018/10/24
 */
@FeignClient(name = CourseBaseService.appName,configuration = FeignAuthConfig.class)
public interface CourseFavoritesService extends CourseBaseService {

    /**
     * 保存用户收藏课记录
     * @param userId 用户ID
     * @param courseId 课程ID
     * @return
     */
    @RequestMapping(contextPath + "/saveCourseFavorites")
    Map<String,Object> saveCourseFavorites(@RequestParam("userId") BigDecimal userId,
                                           @RequestParam("courseId") BigDecimal courseId);

    /**
     * 获取用户的单个课程收藏记录
     * @param userId 用户ID
     * @param courseId 课程ID
     * @return CourseFavorites
     */
    @RequestMapping(contextPath + "/findUserCourseFavorites")
    Map<String,Object> findUserCourseFavorites(@RequestParam("userId") BigDecimal userId,
                                               @RequestParam("courseId") BigDecimal courseId);
}
